﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using WuDada.Core.Post;
using WuDada.Core.Post.Service;
using WuDada.Core.Post.Domain;

public partial class profile : System.Web.UI.Page
{
    private PostFactory m_PostFactory;
    private IPostService m_PostService;
    private int m_PostId = 0;

    //關於銀河 NodeId=2
    private int m_NodeId = 2;

    protected void Page_Load(object sender, EventArgs e)
    {
        m_PostFactory = new PostFactory();
        m_PostService = m_PostFactory.GetPostService();
        m_PostId = QueryStringHelper.GetInteger("id", 0);

        if (!IsPostBack)
        {
            PostVO postVO = m_PostService.GetPostById(m_PostId);
            if (postVO != null)
            {
                ltlTitle.Text = postVO.Title;
                ltlTitle2.Text = postVO.Title;
                ltlContent.Text = postVO.HtmlContent;
            }

            FillLeftMenu();
        }
    }

    private void FillLeftMenu()
    {
        Dictionary<string, string> conditions = new Dictionary<string, string>();
        conditions.Add("NodeId", m_NodeId.ToString());
        conditions.Add("Flag", "1");
        RepeaterAboutus.DataSource = m_PostService.GetPostList(conditions);
        RepeaterAboutus.DataBind();
    }
}